home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
byte0887.arc
/
LANE.ARC
/
MEMORY.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-05-07
|
909b
|
26 lines
10 ' Program to create MEMORY.ARI file for Prolog program
20 ' for "Simulating a Microprocessor with Prolog"
30 ' by Alex Lane
40 '
100 OPEN "MEMORY.ARI" FOR OUTPUT AS 1
110 PRINT#1, "% File: MEMORY.ARI"
120 PRINT#1, "% from Simulating a Microprocessor with Prolog by Alex Lane"
130 PRINT#1, "%"
140 PRINT#1, "% This file contains a predicate that initializes"
150 PRINT#1, "% a 256-byte memory"
160 PRINT#1, "% To 'run' a program on the simulated microprocessor,
170 PRINT#1, "% insert the appropriate machine code bytes into
180 PRINT#1, "% the memory locations
190 PRINT#1, "%"
200 PRINT#1, "init_mem :-"
210 PRINT#1, " asserta(top_of_memory(255)),"
220 FOR I = 0 TO 254
230 IS$ = STR$(I)
240 PRINT#1, " assertz(memory("; IS$; ",0)), % NOP"
250 NEXT I
260 PRINT#1, " assertz(memory( 255,0)). % NOP"
300 PRINT#1, "%"
310 PRINT#1, "% end"
320 CLOSE
400 END